﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using AForge.Imaging.Filters;

namespace Imaging
{
    public partial class ThresholdFilterUC : UserControl, IFilterConfig
    {
        private Threshold thresholdFilter = new Threshold();

        public ThresholdFilterUC()
        {
            InitializeComponent();
        }

        #region IFilterConfig Members

        public AForge.Imaging.Filters.IFilter Filter
        {
            get { return this.thresholdFilter; }
        }

        public UserControl FilterGUI
        {
            get { return this; }
        }

        public string FilterName
        {
            get { return "Threshold filter"; }
        }

        #endregion

        private void tbThreshold_Scroll(object sender, EventArgs e)
        {
            this.thresholdFilter.ThresholdValue = Convert.ToByte(tbThreshold.Value);
        }
    }
}
